import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Hi from '@/components/Hi'
import Hi1 from '@/components/Hi1'
import Hi2 from '@/components/Hi2'
import Hi3 from '@/components/Hi3'
import Hi4 from '@/components/Hi4'
import Hi5 from '@/components/Hi5'
import Error from '@/components/Error'
import Params from '@/components/params'
import Count from '@/components/count'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/Hi',
      component: Hi,
      children: [
        {path:'/',name: 'Hello/Hi',component:Hi},
        {path:'Hi1',name: 'Hi1',component:Hi1},
        {path:'Hi2',name: 'Hello/Hi/Hi2',component:Hi2}
        
      ]
    },
    {
      path: '/MultiHi',
      components: {
        default:HelloWorld,
        left:Hi3,
        right:Hi4
      }
    },
    {
      path: '/reverseMultiHi',
      components: {
        default:Hi,
        left:Hi4,
        right:Hi3
      }
    },
    {
      path:'/aaa/:newsId(\\d+)/:newsTitle',
      component: Params
    },
    {
      path:'/goaaa/:newsId(\\d+)/:newsTitle',
      redirect:'/aaa/:newsId(\\d+)/:newsTitle'
    },
    {
      path: '/goHome',
      redirect: '/'
    },
    {
      path: '/goHi5',
      component: Hi5,
      alias: '/jspang'
    },
    {
      path:'*',
      component:Error
    },
    {
      path:'/count',
      component:Count
    }
  ]
})
